<?php

require dirname(__FILE__) . "/../classes/imageClass.php";
require dirname(__FILE__) . "/../classes/albumClass.php";
require dirname(__FILE__) . "/../classes/connectionFactoryClass.php";
require dirname(__FILE__) . "/../classes/imageDao.php";
require dirname(__FILE__) . "/../classes/albumDao.php";


$iduser = $_SESSION['userId'];
$image = new ImageClass();
$album = new albumClass();
$c = new ConnectionFactory();
$db = $c->getConnection();
$imageDao = new imageDao($db);
$albumDao = new albumDao($db);


$idPhoto = $_GET['id'];
$foto = $imageDao->getById($idPhoto);

$album = $albumDao->getAlbuns($iduser, $foto->getAlbumId());
$dir = $album[0]->getDirectory() . $album[0]->getNameUser() . '/' . $album[0]->getNameAlbum() . '/' . $foto->getName_photo();
$filename='../'.$dir;
?>
